export default {
  props: {
    usClass: {
      type: Boolean,
      default: false
    },
    isImg: {
      type: Boolean,
      default: false
    },
    storeItem: {
      type: Object,
      default: {}
    },
    address: {
      type: String,
      default: ""
    }
  },
  data() {
    return {
      activeNames: []
    };
  },
  filters: {
    kmUnit(value) {
      let v;
      if (typeof value === "number" && !isNaN(value)) {
        if (value >= 1000) {
          v = (value / 1000).toFixed(2) + "km";
        } else {
          v = value + "m";
        }
      } else {
        v = "0m";
      }
      return v;
    }
  },
  activated() {},
  methods: {
    navigation(...params) {
      let [latitude, longitude, storeName] = [...params];
      let point = this.fun.bd_decrypt(longitude, latitude);
      this.fun.goToWXAdress(point, storeName);
    },
    callStore(phone) {
      window.location.href = "tel://" + phone;
    },
    storeNavigation(id) {
      this.$router.push(this.fun.getUrl("commodity", {}, { storeId: id }));
    }
  }
};
